# 业务测试/冒烟
import requests

from api.api_factory import ApiFactory
from config import log


class TestTenderList:
    def setup(self):
        self.session = requests.session()
        self.api = ApiFactory(self.session)

    def teardown(self):
        self.session.close()

    def test01_tender_list(self):
        try:
            # 获取图片验证码
            self.api.get_register_login().api_img_code(123123)
            # 获取手机验证码
            self.api.get_register_login().api_phone_code("13332213448", 666666)
            # 注册
            self.api.get_register_login().api_register("13332213448", "test123", 666666, 888888)
            # 登录
            self.api.get_register_login().api_login("13332213448", "test123")
            # 认证
            self.api.get_approve_trust().api_approve()
            # 开户
            self.api.get_approve_trust().api_trust()
        except Exception as e:
            log.error(e)
            raise
